package com.mxpio.erp.mes.service.impl;

import com.mxpio.erp.common.mes.entity.ManufactureWorkOrderSn;
import com.mxpio.erp.common.mes.service.ManufactureWorkOrderSnService;
import com.mxpioframework.jpa.JpaUtil;
import com.mxpioframework.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ManufactureWorkOrderSnServiceImpl extends BaseServiceImpl<ManufactureWorkOrderSn> implements ManufactureWorkOrderSnService {

    @Transactional
    @Override
    public int relateBatchCode(ManufactureWorkOrderSn sn){
        return JpaUtil.linu(ManufactureWorkOrderSn.class).equal("snCode", sn.getSnCode()).set("batchCode", sn.getBatchCode()).update();
    }
}
